import api from "./index";

/** 获取年级等级列表(cy) */
export const getLearnSectionGrades = param =>
  api.get("/api/common/getLearnSectionGrades", param);

/** 获取带字母排行的城市列表（cy）
 * @param {object} param
 */
export const getLetterSortCitys = param =>
  api.get("/api/common/getLetterSortCitys", param);

/** 获取各城市区校区(cy)
 * @param {object} param
 * @param {string} param.city_id
 */
export const getRegionCampus = param =>
  api.get("/api/common/getCampusByCity", param);

/** 根据性别返回默认头像（cy）
 * @param {object} param
 * @param {number} param.gender 1:男 2：女
 */
export const getAvatarByGender = param =>
  api.get("/api/common/getDefaultAvatarByGender", param);

/** 获取小程序openid等信息
 * @param {object} param
 * @param {number} param.code 1:男 2：女
 */
export const getMiniProgramInfo = param =>
  api.get("/api/loginRegister/getMiniProgramInfo", param);

/** 获取默认头像(cy)
 */
export const getDefaultAvatar = param =>
  api.get("/api/common/getDefaultAvatar", param);

/** 获取年级列表
 * @param {object} param
 */
export const getGrades = param => api.get("/api/common/getGrades", param);

/** 获取城市列表
 * @param {object} param
 */
export const getCities = param => api.get("/api/common/getCitys", param);

/* oss获取签名 */
export const getUploadSignature = param =>
  api.get("/api/common/getUploadSignature", param);

/* 判断token是否失效 */
export const checkTokenIsValid = param =>
  api.post("/api/loginRegister/checkTokenIsValid", param);

/* 判断token是否失效 */
export const pushMessage = param => api.post("/api/common/pushMessage", param);

/** 判断token是否失效
 * @param {Object} param
 * @param {string} param.sessionKey
 * @param {string} param.encryptedData
 * @param {string} param.iv
 */
export const getMiniProgramPhone = param =>
  api.get("/api/loginRegister/getMiniProgramPhone", param);
